using System;
using System.ComponentModel;
using Onca.Model.Components;

namespace DynamicProxy
{
	/// <summary>
	/// </summary>
	public class TestBed
	{
		/// <summary>
		/// </summary>
		[STAThread]
		static void Main( string[] args ) {
            ITesteInterface test = (ITesteInterface)ProxyFactory.GetInstance().Create(new TestImpl(), typeof(TestImpl));
            test.finalize();
            test.information();
            test.initialize();
            test.resume();
            test.suspend();
            test.teste();
		}
	}

    public interface ITesteInterface : Onca.Model.Components.IComponent
    {
        void teste();
    }

    public class TestImpl : ITesteInterface
    {

        #region IComponent Members

        public void teste()
        {
            Console.WriteLine("teste()");
        }

        public void finalize()
        {
            Console.WriteLine("finalize()");
        }

        public IComponentInformation information()
        {
            Console.WriteLine("information()");
            return null;
        }

        public void initialize()
        {
            Console.WriteLine("initialize()");
        }

        public void resume()
        {
            Console.WriteLine("resume()");
        }

        public void suspend()
        {
            Console.WriteLine("suspend()");
        }

        #endregion
    }
}
